import { h } from 'vue';
import { NTag } from 'naive-ui';
import { BasicColumn } from '@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '序号',
    key: 'id',
    align: "center"
  }, {
    title: '名称',
    key: 'title',
    align: "center"
  }, {
    title: '属性',
    key: 'attr',
    align: "center",
    render(row) {
      if (row.attr == 1) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('个人中心'),
          },
        );
      } else if (row.attr == 2) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('关于我们'),
          },
        );
      } else if (row.attr == 3) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('常见问题'),
          },
        );
      } else if (row.attr == 4) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('我的订单'),
          },
        );
      } else if (row.attr == 5) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('订单详情'),
          },
        );
      } else if (row.attr == 6) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('问题反馈'),
          },
        );
      } else if (row.attr == 7) {
        return h(
          NTag,
          {
            type: 'success',
          },
          {
            default: () => ('扫码充电'),
          },
        );
      }
    }
  }, {
    title: '流量主ID',
    key: 'ad_id',
    align: "center"
  }, {
    title: '状态',
    key: 'delstatus',
    align: "center",
    render(row) {
      if (row.delstatus == 0) {
        return h(
          NTag,
          {
            type: 'info',
          },
          {
            default: () => ('启用'),
          },
        );
      } else if (row.delstatus == 1) {
        return h(
          NTag,
          {
            type: 'info',
          },
          {
            default: () => ('禁用'),
          },
        );
      }
    }
  }
];
